package combine.utils;

import java.util.regex.Pattern;

public class Regex {
    
	public final static String EMAIL = "^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$";
	
	public final static String PHONE = "1[0-9]\\d{9}";
	
	public final static String NUMBER = "\\d+";
	
	public final static String DOUBLE = "\\d+(\\.\\d*)?|\\.\\d+$";
	
	public static boolean validateRegex(String text, String regex) {
		if(text == null || text.length() == 0)
			return true;
		return Pattern.compile(regex).matcher(text).matches();
	}
}
